import { MaybeRef } from "vue"
import { PaginationParams } from "@purchasing/components"
import { useAssembledUrl } from "@/composables/url"

import { useApi } from "./api"

export function useGetResources(
  params: MaybeRef<{ keyword?: string }>,
  pagination: MaybeRef<PaginationParams>,
) {
  const url = useAssembledUrl("/resources", params, pagination)
  return useApi(url).get().json()
}
